home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / optimr.zip / OTDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1992-10-02  |  496b  |  21 lines

  1. program OpTimerDemo;
  2.   {-Simple demonstration program for OPTIMER unit}
  3. uses
  4.   OpTimer, Crt;
  5. var
  6.   DelayCount : Word;
  7.   Start, Stop : LongInt;
  8. begin
  9.   repeat
  10.     WriteLn;
  11.     Write('Enter time to delay (in ms), or 0 to quit: ');
  12.     ReadLn(DelayCount);
  13.     if DelayCount > 0 then begin
  14.       Start := ReadTimer;
  15.       Delay(DelayCount);
  16.       Stop := ReadTimer;
  17.       WriteLn('Elapsed time (in ms): ', ElapsedTimeString(Start, Stop));
  18.     end;
  19.   until (DelayCount = 0);
  20. end.
  21.